﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SeaBattle.UI.Web.Models;
using SeaBattle.Domain.Abstract.Services;

namespace SeaBattle.UI.Web.Controllers
{
    [Authorize]
    public class ProfileController : Controller
    {
        private IPlayerService playerService;

        public ProfileController(IPlayerService playerService)
        {
            this.playerService = playerService;
        }

        public ActionResult Index(string login)
        {
            var player = playerService.GetPlayer(login);
            return View(new ProfileViewModel { Player = player });
        }

    }
}
